#!/bin/bash

# count freedisk
disk_size=$(df /|awk '/\//{print $4}')
# count freemem
mem_size=$(free | awk '/Mem/{print $4}')

while [ 1 -le 3 ]
do
if [ $disk_size -le 512000 -a $mem_size -le 1024000 ];then
	mail -s Warning root << EOF 
	insufficient resources
EOF
fi
done
